package com.fcgzs.springboot.controller;

import com.fcgzs.springboot.service.OrderService;
import com.fcgzs.springboot.util.Result;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
import java.util.Set;
import java.util.function.IntUnaryOperator;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Reference //错误解决：导包应为dubbo下的
    private OrderService orderService;

    //DTO思想
    //提交预约
    @RequestMapping("/submitOrder")
    public Result submitOrder(@RequestBody Map map){
        return orderService.submitOrder(map);
    }

    //预约成功、展示套餐信息
    @RequestMapping("/findOrderById")
    public Result findOrderById(Integer id){
        return orderService.findOrderById(id);
    }
}